home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 5: The Fifth Dimension
/
17 Bit - The Fifth Dimension (1995)(17 Bit Software)[!].iso
/
files
/
3495.dms
/
3495.adf
/
ProNET
/
autodoc
/
pronet.doc
Wrap
Text File
|
1992-09-02
|
6KB
|
181 lines
TABLE OF CONTENTS
pronet.device/--Overview--
pronet.device/OpenDevice
pronet.device/CMD_WRITE
pronet.device/ReceivedData
pronet.device/GetConfigString
pronet.device/FreeConfigString
pronet.device/--Overview-- pronet.device/--Overview--
ProNET.device is able to connect two machines for transfering data between
them. For the transfer, you must select a so-called PORT number, which
must be specified at device opening time, and when sending data to the
corresponding port at the other machine, only the application that has this
number will receive the data. If the destination port doesn't exist on the
other Amiga, the data will be buffered and will be sent at once when an
application opens this port.
This device differs from most other devices in so far as the command
CMD_READ is not recognized at all. Instead, every chunk of data arriving
at your port will be sent to a MessagePort you also specified at opening
time, no matter if you want it or not. This message must be ReplyMsg()ed
after evaluating the data.
The configuration of the device and applications using it is done by the
file DEVS:ProNET.config. It is built as follows:
title data or
; Comment
'title' is a string normally ending with a colon (':'), and 'data' may be
any string which can be got using the #?ConfigString-Functions.
An important line in DEVS:ProNET.config is the line starting with
'pronet-device:': The number behind it is used for the transfer routines.
One Amiga must have number 0, the other one must have number 1. If this is
not the case, the device will never return from the opening function or
won't be opened at all.
pronet.device/OpenDevice pronet.device/OpenDevice
NAME
OpenDevice -- a request to open a ProNET port
SYNOPSIS
error = OpenDevice("pronet.device", unit, PNRequest, flags )
d0 a0 d0 a1 d1
FUNCTION
Some components of the PNRequest structure must be filled in before
calling OpenDevice:
pnr_MsgPort Pointer to a Message Port where incoming
data is sent to.
pnr_NetSourcePort Put your port number here. 0 is reserved
for the pronet-handler/-server stuff.
These two values MUST remain until closing the device.
-1 in pnr_NetSourcePort has a special meaning: The port number
will be taken from the ProNET.config file. pnr_Data1 must then
point to the title string introducing the line. The first number
in the data string will then be used as the port number. If the
configuration file is incomplete, the device will return
PNDERR_BADCONFIG !
-2 in pnr_NetSourcePort also has a special meaning: The device
takes the next free portnumber.
The new portnumber will then be put in pnr_NetSourcePort.
INPUTS
"pronet.device" a pointer to the name of the device to be opened.
May be another device as well as long as it emulates
the original !!
unit unused and should be set to 0 !!
PNRequest a pointer to a PNRequest block
flags unused and should be set to 0 !!
RESULTS
error 0 --> opening OK.
PNDERR_BADCONFIG - see descr. of pnr_NetSourcePort
PNDERR_PORTEXISTS - port number is already allocated
pronet.device/CMD_WRITE pronet.device/CMD_WRITE
NAME
CMD_WRITE -- send data to the other Amiga
(also PND_WRITE)
FUNCTION
Sends the data specified in the PNRequest structure as soon as
possible to other machine.
The data consists of the second chunk appended to the first one.
Both chunks added must NOT be longer than $4000 / 16K bytes !!
If the destination port doesn't exist on the remote machine, it
will be buffered there until the port is opened. The data will
be then sent in the order it was sent off.
IO REQUEST
io_Command CMD_WRITE / PND_WRITE
pnr_NetDestPort Destination port number
pnr_Data1 Pointer to first chunk
pnr_Length1 Length of first chunk
pnr_Data2 Pointer to second chunk
pnr_Length2 Length of second chunk
If you just want to transfer one chunk, set pnr_Length2 to zero.
RESULTS
io_Error always zero.
BUGS
Until now, the machine is freezed while sending. (Bug?)
NOTE
I-M-P-O-R-T-A-N-T:
Maximum length is 16K !!
Both lengths are rounded up to word boundaries.
Besides that, the contents of the PNRequest will not be changed !
SEE ALSO
pronet.device/ReceivedData pronet.device/ReceivedData
Received Data will be sent to the Message Port you specified when you
opened 'pronet.device'. The data part starts behind the Message structure.
It first contains the source port as one word, then the real data. Besides
that, MN_LENGTH contains the length of the data including the source port
word, and the first word of the LN_NAME pointer contains the destination
port number (which shouldn't be of any use at all..)
After evaluation of the message, it should be replied.
pronet.device/GetConfigString pronet.device/GetConfigString
NAME
GetConfigString -- get string out of DEVS:ProNET.config
SYNOPSIS
configstr = GetConfigString(titlestring);
D0 A0
APTR GetConfigString(char *);
FUNCTION
Returns the data string corresponding to the title string.
Must be released by FreeConfigString().
INPUTS
titlestring Pointer to null-terminated string. Usually ending
with a colon (':').
RESULT
configstr Pointer to null-terminated string.
SEE ALSO
FreeConfigString()
pronet.device/FreeConfigString pronet.device/FreeConfigString
NAME
FreeConfigString -- free string got by GetConfigString()
SYNOPSIS
FreeConfigString(configstring);
A0
FreeConfigString(char *);
FUNCTION
Frees memory used by the string got by GetConfigString().
INPUTS
configstring Pointer to string got by GetConfigString().
SEE ALSO
GetConfigString()